#include "UGApplication.h"

namespace ugame {
    UGApplication* sharedUGApplication = NULL;
    UGApplication::UGApplication(){
        this->sharedEventNotifier = NULL;
    }
    UGApplication::~UGApplication(){
        CC_SAFE_RELEASE(this->sharedEventNotifier);
    }
    
    UGApplication* UGApplication::getInstance(){
        if (sharedUGApplication == NULL) {
            sharedUGApplication = new UGApplication();
            sharedUGApplication->sharedEventNotifier = new UGDefaultEventNotifier();
            Director::getInstance()->getScheduler()->scheduleUpdate((UGDefaultEventNotifier*)sharedUGApplication->sharedEventNotifier, 1, false);
        }
        return sharedUGApplication;
    }
}